GATE Exam  >  GATE Questions  >   Which of the following is correct output for... Start Learning for Free
Which of the following is correct output for the program code given below?
main( )
{
void pr( );
pr ( );
pr ( );
pr ( );
void pr ( )
{
static int i = 1;
printf (“%c”, (65+ i ++));
}
}
  • a)
    BCD
  • b)
    BBB
  • c)
    ABC
  • d)
    None of these
Correct answer is option 'A'. Can you explain this answer?
Verified Answer
Which of the following is correct output for the program code given b...
The correct output is “BCD” when the function pr ( ) is first called the value of i is initialized to 1.
After the pr ( ) completes its execution i = 2 is retained for it’s next call as “i” is a static variable.
∴ 65 + 1 = 66 = B
65 + 2 = 67 = C
65 + 3 = 68 = D
∴ BCD is the correct output.
View all questions of this test
Explore Courses for GATE exam
Which of the following is correct output for the program code given below?main( ){void pr( );pr ( );pr ( );pr ( );void pr ( ){static int i = 1;printf (“%c”, (65+ i ++));}}a)BCDb)BBBc)ABCd)None of theseCorrect answer is option 'A'. Can you explain this answer?
Question Description
Which of the following is correct output for the program code given below?main( ){void pr( );pr ( );pr ( );pr ( );void pr ( ){static int i = 1;printf (“%c”, (65+ i ++));}}a)BCDb)BBBc)ABCd)None of theseCorrect answer is option 'A'. Can you explain this answer? for GATE 2024 is part of GATE preparation. The Question and answers have been prepared according to the GATE exam syllabus. Information about Which of the following is correct output for the program code given below?main( ){void pr( );pr ( );pr ( );pr ( );void pr ( ){static int i = 1;printf (“%c”, (65+ i ++));}}a)BCDb)BBBc)ABCd)None of theseCorrect answer is option 'A'. Can you explain this answer? covers all topics & solutions for GATE 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Which of the following is correct output for the program code given below?main( ){void pr( );pr ( );pr ( );pr ( );void pr ( ){static int i = 1;printf (“%c”, (65+ i ++));}}a)BCDb)BBBc)ABCd)None of theseCorrect answer is option 'A'. Can you explain this answer?.
Solutions for Which of the following is correct output for the program code given below?main( ){void pr( );pr ( );pr ( );pr ( );void pr ( ){static int i = 1;printf (“%c”, (65+ i ++));}}a)BCDb)BBBc)ABCd)None of theseCorrect answer is option 'A'. Can you explain this answer? in English & in Hindi are available as part of our courses for GATE. Download more important topics, notes, lectures and mock test series for GATE Exam by signing up for free.
Here you can find the meaning of Which of the following is correct output for the program code given below?main( ){void pr( );pr ( );pr ( );pr ( );void pr ( ){static int i = 1;printf (“%c”, (65+ i ++));}}a)BCDb)BBBc)ABCd)None of theseCorrect answer is option 'A'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Which of the following is correct output for the program code given below?main( ){void pr( );pr ( );pr ( );pr ( );void pr ( ){static int i = 1;printf (“%c”, (65+ i ++));}}a)BCDb)BBBc)ABCd)None of theseCorrect answer is option 'A'. Can you explain this answer?, a detailed solution for Which of the following is correct output for the program code given below?main( ){void pr( );pr ( );pr ( );pr ( );void pr ( ){static int i = 1;printf (“%c”, (65+ i ++));}}a)BCDb)BBBc)ABCd)None of theseCorrect answer is option 'A'. Can you explain this answer? has been provided alongside types of Which of the following is correct output for the program code given below?main( ){void pr( );pr ( );pr ( );pr ( );void pr ( ){static int i = 1;printf (“%c”, (65+ i ++));}}a)BCDb)BBBc)ABCd)None of theseCorrect answer is option 'A'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Which of the following is correct output for the program code given below?main( ){void pr( );pr ( );pr ( );pr ( );void pr ( ){static int i = 1;printf (“%c”, (65+ i ++));}}a)BCDb)BBBc)ABCd)None of theseCorrect answer is option 'A'. Can you explain this answer? tests, examples and also practice GATE tests.
Explore Courses for GATE exam
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev